import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

class Animal {
    // public final String name = "123"
    public String name="123" ;
    public int age;

    static {
        System.out.println("Animal static{}");
    }

    {
        System.out.println("Animal{}");
    }

    public Animal(){
        System.out.println("Animal()");
    }

    public Animal(String name,int age){
        this.name=name;
        this.age=age;
        System.out.println("带有两个参数的构造方法！");
    }
    public void eat(){
        System.out.println(name+"正在吃饭！");
    }
}

class Dog extends Animal{
    static{
        System.out.println("Dog static{}");
    }

    {
        System.out.println("Dog{}");
    }

    public Dog(){
        //super();    //编译器会自动添加
        System.out.println("Dog()");
    }

    public Dog(String name,int age){
        //super();

        super(name,age);    //显示的调用父类的构造方法，帮助父类的成员进行初始化

        //name="二哈";
        //age=10;
    }

    public void calling(){
        System.out.println(name+"汪汪叫！");
    }

}

class cat extends Animal{
    public cat(){
        super();
    }

    public int size;
    public cat(String name,int age,int size){
        super();
        this.size=size;
    }

    public cat(String name,int age){
        super(name,age);
    }

    public void calling1(){
        System.out.println(name+"喵喵叫！！");
    }

}

public class test_11_11 {
//    public static void main(String[] args) {
//        Dog d=new Dog();
//        d.name="拉布拉多";
//        d.calling();
//        d.eat();
//        System.out.println("------------------");
//        cat c=new cat();
//        c.name="布偶猫";
//        c.calling1();
//        c.eat();
//
//    }


//    public static void main(String[] args) {
//        Dog d=new Dog();
//        System.out.println("--------------");
//        cat c=new cat();
//
//    }


//    public static void main(String[] args) {
//        final int A=10;
//        System.out.println(A);
//    }


}





